try {
    var resp,
        params = JSON.parse(value),
        req = new CurlHttpRequest(),
        fields = {
            'msgtype': 'markdown',
            'markdown': {},
            'at': {
                'atMobiles': []
            }
        };

    req.AddHeader('Content-Type: application/json');

    fields.markdown.title = '@' + params.to + ' ' +params.subject
    // fields.markdown.text = params.message + '\n\n' + ' @' + params.to
    fields.markdown.text = params.message.replace('@{ALERT.SENDTO}', '@' + params.to)
    fields.at.atMobiles = [params.to];

    resp = req.Post(params.url, JSON.stringify(fields));
    if (resp !== null) {
        resp = JSON.parse(resp);
        if (resp.errcode !== 0) {
            msg = '[ DingTalk Webhook ] Error message: ' + resp.errmsg;
            Zabbix.Log(3, msg);
            throw msg
        } else {
            return resp.errmsg;
        }
    } else {
        msg = '[ DingTalk Webhook ] Null response: ' + req.Status();
        Zabbix.Log(3, msg);
        throw msg
    }
} catch (error) {
    msg = '[ DingTalk Webhook ] Error: ' + error;
    Zabbix.Log(3, msg);
    throw msg;
}